<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="商品状态" prop="productFlag">
        <el-select v-model="queryParams.productFlag" placeholder="请选择商品状态" clearable>
          <el-option v-for="dict in dict.type.product_flag" :key="dict.value" :label="dict.label" :value="dict.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="商品标题" prop="productName">
        <el-input v-model="queryParams.productName" placeholder="请输入商品标题" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="店铺名称" prop="storeName">
        <el-input v-model="queryParams.storeName" placeholder="请输入店铺名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商品编号" prop="productCode">
        <el-input v-model="queryParams.productCode" placeholder="请输入商品编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="productinfoList" style="width: 100%">
      <el-table-column type="expand" style="width: 1px;">
        <template slot-scope="props">
          <div style="display: flex;">
            <div>订单编号：234242244242432</div>
            <div>创建时间：{{props.row.crTime}}</div>
          </div>
          <el-table :data="props.row.orderDetails" :show-header="false">
            <el-table-column label="店铺名称" prop="backSerial"></el-table-column>
            <el-table-column label="商品金额" prop="backSerial"></el-table-column>
            <el-table-column label="实付金额" prop="backSerial"></el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <router-link :to="'/order/allOrdersDetails'" class="link-type">
                  <el-button size="mini" type="text" icon="el-icon-edit" @click="viewDetails(scope.row)">查看详情</el-button>
                </router-link>
              </template>
            </el-table-column>
          </el-table>
        </template>
      </el-table-column>
      <el-table-column label="店铺名称" prop="orderSerial">
      </el-table-column>
      <el-table-column label="商品金额" prop="crTime">
      </el-table-column>
      <el-table-column label="实付金额" prop="crTime">
      </el-table-column>
      <el-table-column label="操作" prop="crTime">
      </el-table-column>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getProductinfoNew" />
  </div>
</template>

<script>
  import {
    fileDeleteOss
  } from "@/api/system/user";

  import {
    getProductinfo,
    getinventorylist,
    getProductinfoNew,
    productCodeEditDetails
  } from "@/api/store/productinfo";

  import {
    getOrderheadList
  } from "@/api/store/orderhead";

  export default {
    name: "Productinfo",
    dicts: ['product_flag'],
    data() {
      return {
        groundVisible: false, //上架
        offShelfVisible: false, //下架
        nestedTableData: [],
        dictArr: [{
            value: '0',
            label: '未生效'
          },
          {
            value: '1',
            label: '已生效'
          }
        ],
        tableData: [],
        editForm: {},
        dialogVisible: false,
        dialogTitle: '',
        tabPosition: 'left',
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 商品类目表格数据
        productinfoList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          storeName: '',
          productCode: '',
          productFlag: '',
          productName: '',
        },
        // 表单参数
        form: {},
        xlsFile: [],
        fileListN: [],
        listNew: [],
        xlsFile1: [],
        fileListN1: [],
        listNew1: [],
        // 表单校验
        rules: {},
        allList: [],

        addressXz: [],
        propsObj: {
          label: 'text',
          value: 'value',
          option: 'children',
        },
        pastInventoryList: [],
        pastProductInfo: {},
        // 修改的
        updateInventoryList: [],
        // 新增的
        insertInventoryList: [],
        inventoryIdids: [],
        viewDialogVisible: false,
        viewGgData: []
      };
    },
    created() {
      this.getProductinfoNew()
    },
    methods: {
      // 0929 start
      getProductinfoNew() {
        let params = {
          pageNum: this.queryParams.pageNum,
          pageSize: this.queryParams.pageSize,
          // storeName: this.queryParams.storeName,
          // productCode: this.queryParams.productCode,
          // productFlag: this.queryParams.productFlag,
          // productName: this.queryParams.productName,
        }
        // 回显规格接口
        getOrderheadList(params).then(response => {
          if (response.code == '200') {
            this.loading = false
            this.productinfoList = response.data
            this.total = response.total
            console.log(response.data, '1111111111111111111')
          }
        });
      },

      viewDetails() {

      },

      shopAdd() {
        this.$router.push("/productinfoDetails");
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          storeName: '',
          productCode: '',
          productFlag: '',
          productName: '',
        };
        this.resetForm("form");
        this.xlsFile = [];
        this.fileListN = [];
        this.listNew = [];
        this.tableData = []

      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getProductinfoNew();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
    }
  };
</script>
<style>
.el-table__row.expanded{
  display: none;
}
  /* .el-table {
    border-top: none !important;
  }

  .el-table__expanded-cell {
    padding: 0 !important;
  }

  .tableWrap {
    width: 100%;
  }

  .el-tabs__nav-scroll {
    padding: 0 20px;
    box-sizing: border-box;
  }

  .tableWrap .el-table {
    width: 1240px;
    margin: 0 auto;
  }

  .el-icon.el-icon-arrow-right {
    color: #fff;
  }

  .el-table__row.expanded {
    background: #fff !important;
    position: relative !important;
    top: -100px !important;
    border: 1px solid red;
  }

  .el-tabs__content {
    display: none;
  }

  .el-table__row.expanded>td {
    padding: 7px 0;
  }

  .el-table__row.expanded {
    border: 1px solid #E5E5E5;
  }

  .el-table__row.expanded:first-child {
    border-bottom: none;
  }

  .childTable .el-table__body {
    border-top: 1px solid #E5E5E5;
  }

  .childTable .el-table__row.expanded>td:first-child {
    border-left: 1px solid #E5E5E5;
  }

  .childTable .el-table__row.expanded>td:last-child {
    border-right: 1px solid #E5E5E5;
  }

  .el-tabs__header.is-top {
    border-bottom: none;
  }

  .childTable .el-table__header-wrapper {
    display: none;
  }

  .conWrap {
    height: 44px;
    background: #E5E5E5;
    line-height: 44px;
    padding-left: 10px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    line-height: 19px;
    color: #333333;
  }

  .conWrap>span {
    line-height: 44px;
  }

  .el-table .has-gutter .is-leaf {
    position: relative !important;
    left: -48px !important;
  }

  .el-table .has-gutter .is-leaf:last-child {
    position: relative !important;
    left: 0px !important;
  }

  .el-table__header-wrapper {
    background: #EBEBEB;
  }

  .el-table .has-gutter>tr>th {
    background: #EBEBEB;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 19px;
    color: #333333;
  } */
</style>
